package com.adt.studioms;

import com.asao.baseware.core.Application;
import com.asao.baseware.core.DefaultApplicationContext;
import com.asao.baseware.core.api.hibernate.HibernateAPIRegistry;
import com.asao.baseware.core.security.IPassport;
import com.asao.baseware.core.security.PassportManager;

public class StudiomsApplication extends Application<DefaultApplicationContext> {
    
    public static StudiomsApplication instance;
       
    
    public StudiomsApplication(String configFilename, String contextName) {
        super(configFilename, contextName);
    }
    
    public StudiomsApplication(String configFilename) {
        super(configFilename);
    }
    
    public HibernateAPIRegistry getApiRegistry() {
        return getContext().getApiRegistry();
    }
    
    public PassportManager getPassportManager() {
        return getContext().getPassportManager();
    }
    
    protected boolean doLogin(String username, String password) {
        return true;
    }

    protected boolean doLogout(IPassport passport) {
        return true;
    }

    @Override
    public void doStart() {
        instance = this;
    }

    @Override
    public void doStop() {
        instance = null;
    }
}
